package com.sparrow.common.ai.behaviortree.task;

import com.sparrow.common.ai.behaviortree.BehaviorContext;
import com.sparrow.common.ai.behaviortree.def.BTNodeStatus;

/**
 * 节点运行时实例，主要为了结构和运行时状态分离 以便复用节点
 */
public abstract class BehaviorTask {

    public BehaviorTask() {

    }

    public abstract BTNodeStatus tick(BehaviorContext context, long now, long delta);

    public void enterTick(BehaviorContext context) {
        if (context.getMonitor() != null) {
            context.getMonitor().onEnterTick(context, this);
        }
    }

    public void reset() {

    };
}
